// 用户等级枚举
export const USER_LEVELS = {
  BRONZE: {
    code: 1,
    name: '青铜',
    minScore: 0,
    maxScore: 100,
    className: 'badge-bronze',
    levelClass: 'level-bronze',
    avatarClass: 'avatar-bronze',
    avatarLargeClass: 'avatar-large-bronze'
  },
  SILVER: {
    code: 2,
    name: '白银',
    minScore: 101,
    maxScore: 500,
    className: 'badge-silver',
    levelClass: 'level-silver',
    avatarClass: 'avatar-silver',
    avatarLargeClass: 'avatar-large-silver'
  },
  GOLD: {
    code: 3,
    name: '黄金',
    minScore: 501,
    maxScore: Infinity,
    className: 'badge-gold',
    levelClass: 'level-gold',
    avatarClass: 'avatar-gold',
    avatarLargeClass: 'avatar-large-gold'
  }
};

// 根据分数获取用户等级
export const getUserLevel = (score) => {
  if (score <= USER_LEVELS.BRONZE.maxScore) {
    return USER_LEVELS.BRONZE;
  } else if (score <= USER_LEVELS.SILVER.maxScore) {
    return USER_LEVELS.SILVER;
  } else {
    return USER_LEVELS.GOLD;
  }
};

// 关卡难度跟金银铜没联系，金银铜用积分去判断
// 关卡难度枚举
// 游戏难度等级常量
export const DIFFICULTY_LEVELS = {
  BEGINNER: 1,
  INTERMEDIATE: 2,
  ADVANCED: 3
};

// 签到奖励配置
export const CHECKIN_REWARDS = [
  { day: 1, score: 10 },
  { day: 2, score: 15 },
  { day: 3, score: 20 },
  { day: 4, score: 25 },
  { day: 5, score: 30 },
  { day: 6, score: 35 },
  { day: 7, score: 50 }
];

// 获取下一次签到的奖励
export const getNextCheckinReward = (checkinDays = 0) => {
  const nextDay = (checkinDays % 7); // 获取下一天的索引（0-6）
  return CHECKIN_REWARDS[nextDay].score;
}; 